﻿@model ArticleCategoryModel
@using CAF.Infrastructure.Core.Domain.Seo;
@{
    Layout = "~/Themes/AlphaCosmetics/Views/Shared/_ColumnsTwo.cshtml";

    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var categoryUrl = Url.RouteUrl("ArticleCategory", new { SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(categoryUrl);
    }


}
@section left {
    @Html.Action("CategoryNavigation", "ArticleCatalog", new { currentCategoryId = this.CurrentArticleCategoryId, currentArticleId = this.CurrentArticleId, onlyShowChildren = true, showParent = true, area = "" })
    @if (Model.Articles.Count > 0 && Model.DisplayFilter)
    {
        <div id="product-filter" class="block block-bordered product-filter-block">
            <form class="filter-product-form" method="GET" action="@Url.Action("Articles", "Filter")" data-multiselecturl="@Url.Action("ArticlesMultiSelect", "Filter")">
                <input type="hidden" name="categoryID" value="@Model.Id" />
                <input type="hidden" name="path" value="@Request.Url.AbsolutePath" />
                <input type="hidden" name="pagesize" value="@Model.PagingFilteringContext.PageSize" />
                <input type="hidden" name="orderby" value="@Model.PagingFilteringContext.OrderBy" />
                <input type="hidden" name="viewmode" value="@Model.PagingFilteringContext.ViewMode" />
                <input type="hidden" name="filter" value="@Request.QueryString.Get("filter")" />
                <input type="hidden" name="filterMultiSelect" value="" />
            </form>
            <div class="block-title">
                @T("Filtering.FilterResults")
            </div>
            <div class="block-body listbox"></div>
            <div id="product-filter-modal" class="modal hide fade" tabindex="-1">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><b>x</b></button>
                    <h4 class="caption">Filter</h4>
                </div>
                <div class="modal-body"></div>
                <div class="modal-footer">
                    <a href="javascript:void(0)" class="remove-checkmarks" rel="nofollow">@T("Products.Filter.RemoveCheckmarks")</a>
                    <button class="btn btn-primary" data-dismiss="modal">@T("Common.OK")</button>
                    <button class="btn" data-dismiss="modal">@T("Common.Cancel")</button>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                productFilter.init('#product-filter');
            });
        </script>
    }
}


@if (Model.DisplayCategoryBreadcrumb)
{
    <h3 class="sb--box-title">
        <div class="sb--box-size fl">
            当前位置：<a href="@Url.RouteUrl("HomePage")" title="首页">首页</a> &gt;

            @for (int i = 0; i < Model.CategoryBreadcrumb.Count; i++)
            {
                var menuItem = Model.CategoryBreadcrumb[i];
                var isLastCategory = menuItem.EntityId == Model.Id;

                if (isLastCategory)
                {
                    @menuItem.Text
                }
                else
                {
                    <a href="@menuItem.GenerateUrl(this.Url)" title="@menuItem.Text">@menuItem.Text</a><text>&gt;</text>
                }

            }
        </div>
        <div class="sb--box-right fr"></div>
    </h3>
}

<div class="clear"></div>

@if (Model.Articles.Count > 0)
{
    @*grid mode*@
    <div class="active" id="productlist">
        <ul class="list-none metlist">
            @foreach (var article in Model.Articles)
            {
                @Html.Partial("_ArticleBox", article)
            }
        </ul>
        <div class="clear"></div>
    </div>
}
<div id="flip">
    <div class="digg4 metpager_8">
        @Html.CafSite().Pager(Model.PagingFilteringContext).Name("pagination-bottom").QueryParam("pagenumber").ShowFirst(true).ShowLast(true).ShowNext(true).ShowPrevious(true)

    </div>
</div>